# encoding: UTF-8
 
class Admin::RaidsController < ApplicationController
  
  before_filter :user_signed_in?

  def index
    @raids = Raid.all
    set_seo_meta '游戏攻略'
  end

  def new
    set_seo_meta '游戏攻略新增'
  end

  def create
    @raid = Raid.new(params[:session])
    if @raid.save
      redirect_to raids_path, notice: '新增成功'
    else
      redirect_referrer_or_default
    end  
  end

  def edit
    @raid = Raid.find(params[:id]) 
    set_seo_meta '游戏攻略'
  end

  def update
    @raid = Raid.find(params[:id])
    if @raid.update_attributes!(params[:session])
      redirect_to raids_path, notice:'修改成功'
    else
      redirect_referrer_or_defautl default
    end
  end
  
end
